package com.spring.aop.declareparents;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @ClassName Main
 * @Description
 * @Author suncx
 * @Date 2020/6/27 15:04
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(AppConfiguration.class);
        Animal animal = (Animal)context.getBean("animal");
        animal.swim();
        Food food = (Food)animal;
        food.eat();
    }
}
